home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 12511500 / var1482.dms / var1482.adf / Scripts / pathdemo.mc < prev    next >
Text File  |  1994-07-07  |  4KB  |  106 lines

  1.  
  2.  
  3. /**********************************************************
  4. *
  5. *    a demo of animation using paths.  flies a glider
  6. *    around in a circle.  the glider always points
  7. *    in the direction it's going.
  8. *
  9. *    there a 40 frames in this animation
  10. *
  11. **********************************************************/
  12.  
  13. int numframes = 40
  14.  
  15. real glider_alt    = 15    ; the altitude the glide flies at
  16. real gnd_alt = 0    ; the altitude of the ground
  17. real circ_rad = 30    ; the radius of the glider's circle
  18.  
  19. real dpf = 360/numframes    ; the no. of degrees around the
  20.                 ; circle the glider travels
  21.                 ; each frame
  22.  
  23. path glider_path = {
  24.     <circ_rad*cos(dpf*0), glider_alt, circ_rad*sin(dpf*0)>,
  25.     <circ_rad*cos(dpf*1), glider_alt, circ_rad*sin(dpf*1)>,
  26.     <circ_rad*cos(dpf*2), glider_alt, circ_rad*sin(dpf*2)>,
  27.     <circ_rad*cos(dpf*3), glider_alt, circ_rad*sin(dpf*3)>,
  28.     <circ_rad*cos(dpf*4), glider_alt, circ_rad*sin(dpf*4)>,
  29.     <circ_rad*cos(dpf*5), glider_alt, circ_rad*sin(dpf*5)>,
  30.     <circ_rad*cos(dpf*6), glider_alt, circ_rad*sin(dpf*6)>,
  31.     <circ_rad*cos(dpf*7), glider_alt, circ_rad*sin(dpf*7)>,
  32.     <circ_rad*cos(dpf*8), glider_alt, circ_rad*sin(dpf*8)>,
  33.     <circ_rad*cos(dpf*9), glider_alt, circ_rad*sin(dpf*9)>,
  34.     <circ_rad*cos(dpf*10), glider_alt, circ_rad*sin(dpf*10)>,
  35.     <circ_rad*cos(dpf*11), glider_alt, circ_rad*sin(dpf*11)>,
  36.     <circ_rad*cos(dpf*12), glider_alt, circ_rad*sin(dpf*12)>,
  37.     <circ_rad*cos(dpf*13), glider_alt, circ_rad*sin(dpf*13)>,
  38.     <circ_rad*cos(dpf*14), glider_alt, circ_rad*sin(dpf*14)>,
  39.     <circ_rad*cos(dpf*15), glider_alt, circ_rad*sin(dpf*15)>,
  40.     <circ_rad*cos(dpf*16), glider_alt, circ_rad*sin(dpf*16)>,
  41.     <circ_rad*cos(dpf*17), glider_alt, circ_rad*sin(dpf*17)>,
  42.     <circ_rad*cos(dpf*18), glider_alt, circ_rad*sin(dpf*18)>,
  43.     <circ_rad*cos(dpf*19), glider_alt, circ_rad*sin(dpf*19)>,
  44.     <circ_rad*cos(dpf*20), glider_alt, circ_rad*sin(dpf*20)>,
  45.     <circ_rad*cos(dpf*21), glider_alt, circ_rad*sin(dpf*21)>,
  46.     <circ_rad*cos(dpf*22), glider_alt, circ_rad*sin(dpf*22)>,
  47.     <circ_rad*cos(dpf*23), glider_alt, circ_rad*sin(dpf*23)>,
  48.     <circ_rad*cos(dpf*24), glider_alt, circ_rad*sin(dpf*24)>,
  49.     <circ_rad*cos(dpf*25), glider_alt, circ_rad*sin(dpf*25)>,
  50.     <circ_rad*cos(dpf*26), glider_alt, circ_rad*sin(dpf*26)>,
  51.     <circ_rad*cos(dpf*27), glider_alt, circ_rad*sin(dpf*27)>,
  52.     <circ_rad*cos(dpf*28), glider_alt, circ_rad*sin(dpf*28)>,
  53.     <circ_rad*cos(dpf*29), glider_alt, circ_rad*sin(dpf*29)>,
  54.     <circ_rad*cos(dpf*30), glider_alt, circ_rad*sin(dpf*30)>,
  55.     <circ_rad*cos(dpf*31), glider_alt, circ_rad*sin(dpf*31)>,
  56.     <circ_rad*cos(dpf*32), glider_alt, circ_rad*sin(dpf*32)>,
  57.     <circ_rad*cos(dpf*33), glider_alt, circ_rad*sin(dpf*33)>,
  58.     <circ_rad*cos(dpf*34), glider_alt, circ_rad*sin(dpf*34)>,
  59.     <circ_rad*cos(dpf*35), glider_alt, circ_rad*sin(dpf*35)>,
  60.     <circ_rad*cos(dpf*36), glider_alt, circ_rad*sin(dpf*36)>,
  61.     <circ_rad*cos(dpf*37), glider_alt, circ_rad*sin(dpf*37)>,
  62.     <circ_rad*cos(dpf*38), glider_alt, circ_rad*sin(dpf*38)>,
  63.     <circ_rad*cos(dpf*39), glider_alt, circ_rad*sin(dpf*39)>
  64. }
  65.  
  66. #include "glider.obj"
  67.  
  68. xrotate glider.obj 5                ; a little bit of banking
  69. yrotate glider.obj -dpf*FRAME-90        ; make it face the right direction
  70. translate glider.obj glider_path[FRAME]        ; put it in the right place
  71. instance glider.obj
  72.  
  73. /***************
  74. *
  75. * background stuff 
  76. *
  77. ***************/
  78.  
  79. camera {
  80.     loc    <100, glider_alt*2, 20>
  81.     target    <0, glider_alt, 0>
  82.     hfov    55
  83. }
  84.  
  85. lamp {
  86.     loc    <10, 80, 2>
  87. }
  88.  
  89. color red { diff <1, 0, 0> }
  90. color white { diff <1, 1, 1> }
  91. check rw_check {
  92.     patt1    red
  93.     patt2    white
  94.     xsize    10
  95.     ysize    10
  96.     zsize    10
  97. }
  98.  
  99. paragram {
  100.     patt    rw_check
  101.     loc    <-circ_rad*2, gnd_alt, -circ_rad*2>
  102.     v1    <circ_rad*4, 0, 0>
  103.     v2    <0, 0, circ_rad*4>
  104. }
  105.  
  106.